import {developUrl,serverDK} from '@/views/api/api'
const TOKEN = localStorage.token;
//const developUrl = 'http://192.168.1.157:';/*宣称*/
//const developUrl = 'http://192.168.1.183:';/*英子*/
//const serverDK ='9587/';
import Vue from 'vue';
import axios from 'axios';


export const apiGetYwType = (param) => {/*获取业务类型，网段区域，信息类型*/
  return axios({
    	method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'dictionary/tree/search',
		data:{
			"type":param
		},
  }).then((res) => res)
.catch((error) => {
   console.log('出错',error);
 });
};

export const apiSearchYwType=(param) =>{
	return axios({
    	method : 'post',headers : {'Content-Type' : 'application/json'},
		url : developUrl+serverDK+'resource/service/search',
		data:{
			"businessTypeIds":param.businessTypeIds,
			"serviceType":param.serviceType,
			"name":param.name,
		},
  }).then((res) => res)
.catch((error) => {
   console.log('出错',error);
 });
}

export const apiSearchName=(param) =>{
	return axios({
    	method : 'post',headers : {'Content-Type' : 'application/json'},
		url : developUrl+serverDK+'organization/search',
		data:{
			"pageAble":param.pageAble,
			"type":param.type
		},
  }).then((res) => res)
.catch((error) => {
   console.log('出错',error);
 });
}


export const apiServerRegister=(param) =>{
	return axios({
    	method : 'post',headers : {'Content-Type' : 'application/json'},
		url : developUrl+serverDK+'resource/service/regist',
		data:param,
  }).then((res) => res)
.catch((error) => {
   console.log('出错',error);
 });
}


export const apiServerRegisterGetFabuArea=(param) =>{
	return axios({
    	method : 'post',headers : {'Content-Type' : 'application/json'},
		url : developUrl+serverDK+'area/search',
		data:param,
  }).then((res) => res)
.catch((error) => {
   console.log('出错',error);
 });
}


export const apiGetYuanData2Type = (param) => {
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'metaData/list',
			data:param}).then((res) => res).catch((error) => {console.log('出错',error);});};




export const apiGetFTPData = (param) => {
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'connData/list',
			data:param}).then((res) => res).catch((error) => {console.log('出错',error);});};




export const apiPushDetail = (param) => {
  return axios({method : 'get',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'resource/service/'+param.id+'/detail',
			}).then((res) => res).catch((error) => {console.log('出错',error);});};




export const apiSearchServer = (param) => {
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'resource/service/search',
			data:param}).then((res) => res).catch((error) => {console.log('出错',error);});};
			




export const apiGetServerList = (param) => {
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'organization/search',
			data:param}).then((res) => res).catch((error) => {console.log('出错',error);});};
			

export const apiDealForm = (param) => {
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'resource/service/public',
			data:param}).then((res) => res).catch((error) => {console.log('出错',error);});};
			


export const apiCollectFormPush = (param) => {
  return axios({method : 'post',headers : {'Content-Type' : 'application/json'},
    	url : developUrl+serverDK+'resource/service/gather/public',
			data:param}).then((res) => res).catch((error) => {console.log('出错',error);});};
			

